﻿using System;
using System.Windows;
using System.Windows.Interop;

namespace Byond.Vst.TestHost
{
	public partial class MainWindow
	{
		public MainWindow()
		{
			InitializeComponent();
		}

		private void CreatePluginInstance(object sender, RoutedEventArgs e)
		{
			try
			{
				var stub = new PluginStub();
				stub.Open();
				stub.SetSampleRate(44100);
				stub.SetBlockSize(500);

				var ioh = new WindowInteropHelper(this);
				stub.EditorOpen(ioh.Handle);
			}
			catch (Exception exception)
			{
				MessageBox.Show(exception.Message);
			}
		}
	}
}
